<template>
  <div class="member-center">
    <!-- 侧边栏区域 -->
    <div class="left">
      <!-- 侧边栏区域：顶部按钮 -->
      <div class="top">
        <el-radio-group v-model="isCollapse">
          <el-radio-button size="small" :value="true"></el-radio-button>
          <el-radio-button size="small" :value="false"></el-radio-button>
        </el-radio-group>
      </div>
      <!-- 侧边栏区域：底部菜单 -->
      <div class="bottom">
        <el-menu :default-active="$route.path" class="el-menu-vertical-demo" :collapse="isCollapse">
          <el-menu-item index="/user/certification" @click="goUser('/user/certification')">
            <el-icon><Menu /></el-icon>
            <template #title>实名认证丶艾薇巴蒂</template>
          </el-menu-item>
          <el-menu-item index="/user/order" @click="goUser('/user/order')">
            <el-icon><document /></el-icon>
            <template #title>挂号订单丶艾薇巴蒂</template>
          </el-menu-item>
          <el-menu-item index="/user/patient" @click="goUser('/user/patient')">
            <el-icon><setting /></el-icon>
            <template #title>就诊管理丶艾薇巴蒂</template>
          </el-menu-item>
          <el-menu-item index="/user/profile" @click="goUser('/user/profile')">
            <el-icon><document /></el-icon>
            <template #title>账号信息丶艾薇巴蒂</template>
          </el-menu-item>
          <el-menu-item index="/user/feedback" @click="goUser('/user/feedback')">
            <el-icon><setting /></el-icon>
            <template #title>意见反馈丶艾薇巴蒂</template>
          </el-menu-item>
          <el-menu-item index="2">
            <el-icon><Document /></el-icon>
            <template #title>备选菜单丶艾薇巴蒂</template>
          </el-menu-item>
          <el-menu-item index="3">
            <el-icon><Document /></el-icon>
            <template #title>备选菜单丶艾薇巴蒂</template>
          </el-menu-item>
          <el-menu-item index="4">
            <el-icon><Document /></el-icon>
            <template #title>备选菜单丶艾薇巴蒂</template>
          </el-menu-item>
        </el-menu>
      </div>
    </div>
    <!-- 右侧展示会员中心二级路由组件区域 -->
    <div class="right">
      <!-- 子组件展示结构地方 -->
      <router-view></router-view>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { useRouter, useRoute } from "vue-router";
//折叠面板
const isCollapse = ref(false);
//获取路由器对象
let $router = useRouter();
//获取路由对象
let $route = useRoute();
//点击左侧菜单进行路由的跳转
const goUser = (path: string) => {
  $router.push({ path: path });
}
</script>

<style scoped lang="scss">
.member-center {
  display: flex;

  .left {
    // flex: 1;
    color: #333333;

    .top {
      height: 56px;
      display: flex; //(display: flex;)/(float: left;)/(display: inline-block;)
      justify-content: center;
      align-items: center;
    }
  }

  .right {
    // flex: 1;
    flex-grow: 1;
    flex-shrink: 1;
    color: #333333;
  }
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}

/** 深度选择器：>>>和/deep/和::v-deep */
:deep(.el-menu) {
  border-right: none !important; /* 使用 !important 确保覆盖默认样式 */
  background-color: #f4f4f4;
}
</style>
